//
//  LYHttpReachability.h
//  LYNetworkService
//
//  Created by 九爷 on 2021/12/23.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, LYNetworkReachabilityStatus) {
    LYNetworkReachabilityStatusUnknown          = -1,
    LYNetworkReachabilityStatusNotReachable     = 0,
    LYNetworkReachabilityStatusReachableViaWWAN = 1,
    LYNetworkReachabilityStatusReachableViaWiFi = 2,
    LYNetworkReachabilityStatusReachableViaWWAN2G,
    LYNetworkReachabilityStatusReachableViaWWAN3G,
    LYNetworkReachabilityStatusReachableViaWWAN4G,
    LYNetworkReachabilityStatusReachableViaWWAN5G,
};

typedef NS_ENUM(NSUInteger, LYNetworkNetworkPremissionStatus) {
    LYNetworkNetworkPremissionStatusReject,
    LYNetworkNetworkPremissionStatusAgree,
    LYNetworkNetworkPremissionStatusUnknow,
};

@interface LYHttpReachability : NSObject

@property (nonatomic, assign, readonly) LYNetworkReachabilityStatus currentStatus;

+ (instancetype)manager;

- (BOOL)isReachable;

- (void)startMonitor;

- (void)setStatusMonitor:(void(^)(LYNetworkReachabilityStatus status))block;

- (BOOL)isReachableViaWWAN;

- (BOOL)isReachableViaWiFi;

- (void)networkPremissionStatus:(void(^)(LYNetworkNetworkPremissionStatus status))block;

@end
